Primitive decomposition handles geometric primitives like points, lines, and polygons as well as image primitives like pixel rectangles and bitmaps by transforming the primitives into window coordinates and determining which pixel locations are occupied by each primitive. For each occupied pixel location, a fragment is generated. A fragment is a pixel location accompanied by an assigned color, depth, and texture coordinates as required. The per-fragment operations that follow primitive decomposition use the fragment's associated data to update the pixel corresponding to the fragment.
OpenGL's rasterization state affects primitive decomposition. Factors affecting decomposition include antialiasing, line width, stippling, culling, and the pixel path modes.
Primitives like polygons are typically decomposed into a set of spans. A span is a one-pixel high horizontal line defined by a pixel location and a width. Spans can easily be converted into fragments by iterating across the span. Color, depth, and texture coordinates may be interpolated between the two span end points.
A polygon span converter can be implemented in hardware. The results from the span converter can then be fed to a hardware span engine that iterates across the generated spans doing depth and color interpolations as necessary. To lower the hardware cost of a GTX-RD system, the polygon span conversion may be done on the host so that the primitive decomposition hardware is limited to a span engine. Figure 3 demonstrates how a polygon span converter and span iteration engine combine to render a triangle into fragments. Other primitives such as points or lines can also be converted to spans, or supported by special point and line drawing engines. Similarly, so called bit-blit engines can efficiently render image rectangles and bitmaps. To further minimize the host overhead, graphics hardware may support Direct Memory Access (DMA) of primitives (particularly effective for image primitives). DMA lets the graphics hardware obtain data directly from host memory with minimal host overhead, thereby increasing the transfer speed to the graphics hardware.
Figure 4: OpenGL per-fragment operations.